
<script>
function getSid()
{ldelim}
    //alert(document.newSurvey.copy_survey.value);
    //alert(document.getElementById('preview_').href);
	
	var sid = document.newSurvey.copy_survey.value;
	if(sid == "")
	{ldelim} //quiere decir cuando la lista cambia a la primera opcion(ninguna) el sid es: ""
	    href = "http://#";
	{rdelim}
	else
	{ldelim}
	    href = '{$conf.html}/preview.php?sid=' + sid + '&preview_survey=1';
	{rdelim}
    document.getElementById('preview_').href = href;
{rdelim}
</script>
<form name="newSurvey" method="GET" action="{$conf.html}/new_survey.php">
<input type="hidden" name="a_id" value="{$a_id}" />
<table align="center" bgcolor="#F7F7F7" style="BORDER-RIGHT:#999 1px solid; border-bottom:#999 1px solid; border-left:#999 1px solid; 
        border-top:#999 1px solid;" width="953" border="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td height="19" colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="20" height="19" valign="top" bgcolor="#333333" style="border-bottom:#999999 2px solid;"><!--DWLayoutEmptyCell-->&nbsp;</td>
        <td width="644" valign="middle" bgcolor="#333333" style="border-bottom:#999999 2px solid;" class="style2">Crear
          Nueva Encuesta </td>
        <td width="268" valign="middle" bgcolor="#333333" style="border-bottom:#999999 2px solid;" class="style2" align="right"><a href="{$conf.html}/index.php" class="blanco">[Pagina Principal]</a></td>
        <td width="19" valign="top" bgcolor="#333333" style="border-bottom:#999999 2px solid;"><!--DWLayoutEmptyCell-->&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td width="15" height="152" valign="top" ><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td width="936" valign="top"><table  width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="121" height="11"></td>
        <td width="102"></td>
        <td width="22"></td>
        <td width="127"></td>
        <td width="119"></td>
        <td width="433"></td>
        <td width="12"></td>
      </tr>
      <tr>
        <td height="18"></td>
		<td colspan="5" valign="top">
		  {section name="error" loop=1 show=$error}
		    <span class="error">Error: {$error}</span>
		  {/section}
		</td>
        <td></td>
      </tr>
      {section name="name_survey" loop=1 show=$show.survey_name}
      <tr>
        <td height="30" valign="middle">Nombre de Encuesta </td>
          <td colspan="4" valign="middle"><input type="text" name="survey_name" size="40" maxlength="255" value="{$survey_name}"></td>
          <td></td>
          <td></td>
      </tr>
      <tr>
        <td height="30" valign="middle">Copiar Encuesta </td>
          <td colspan="4" valign="middle"><select name="copy_survey" size="1" onchange="getSid();">
            
          {section name="cs" loop=$public_surveys.sid show=1}
            <option value="{$public_surveys.sid[cs]}">{$public_surveys.name[cs]}</option>
          {/section}
        
          </select> 
		  
           &nbsp; <a id="preview_" href="http://#"  target="_blank" class="negro" title="muestra la encuesta elegida de la lista" ><strong>[Previsualizar]</strong></a>  </td>
          <td></td>
          <td></td>
      </tr>
	  {/section}
      <tr>
        <td height="5"></td>
          <td ></td>
          <td ></td>
          <td ></td>
          <td ></td>
          <td></td>
          <td></td>
      </tr>
      <tr>
        <td height="31"></td>
        <td valign="middle" ><input type="submit" name="creaBasica" value="Crear Basica" title="crear encuesta de una sola pregunta, no copia encuesta"/></td>
          <td >&nbsp;</td>
          <td valign="middle" >
		  {section name="next_button" loop=1 show=$show.next_button}
		  <input type="submit" name="next" value="{$button.next|default:"Crear Avanzada"}" title="crear encuesta de varias preguntas, puede copiar encuestas de la lista" />
		  {/section}
		  </td>
          <td >&nbsp;</td>
          <td ></td>
          <td ></td>
      </tr>
      
      <tr>
        <td height="27"></td>
        <td >&nbsp;</td>
        <td >&nbsp;</td>
        <td >&nbsp;</td>
        <td >&nbsp;</td>
        <td></td>
        <td></td>
      </tr>

      
    </table></td>
  </tr>
  
  <tr>
    <td height="26" colspan="2" valign="top"><table style="border-top:#999 1px solid;"  width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
       <td height="26" align="center" valign="middle" bgcolor="#EBEBEB" style="border-top:#D7D7D7 2px solid; border-bottom:#D7D7D7 2px solid;"><strong> <a href="{$conf.html}/index.php" class="negro">[
           Pagina Principal]</a></strong></td>
      </tr>
    </table></td>
  </tr>
</table>
</form>